<?php

namespace app\controllers;

use app\service\CardService;
use app\service\WxService;
use yii\web\Controller;

class SiteController extends Controller
{

    public $layout = false;

    public function actionIndex()
    {
        $liveSwitch = !!(new CardService())->liveSwitch();

        $wxConfig = (new WxService())->getSignPackage();
        $share = array(
            'title' => $liveSwitch ? '屈臣氏VR直播：杨洋见面会' : '提前收藏！屈臣氏即将直播杨洋见面会',
            'desc' => $liveSwitch ? '快进来和屈臣氏一起环抱暖杨洋，赢取神秘大奖' : '12月3日下午3点，屈臣氏与你一起环抱暖杨洋，全景直播杨洋每一面'
        );

        $params = array(
            'wxConfig' => $wxConfig,
            'share' => $share
        );

        return $this->render('index', $params);
    }

    public function actionError()
    {}

}